package com.hgw.Demo11_VisitorPattern.Exercises26_7_4;

/**
 * Data time:2021/12/21 21:15
 * StudentID:2019112118
 * Author:hgw
 * Description: 收营员，充当具体访问者
 */
public class Cashier extends People{
    @Override
    public void visit(Apple apple) {
        System.out.println("苹果的收您：" + apple.getPrice()*apple.getWeight() + " 元");
    }

    @Override
    public void visit(Book book) {
        System.out.println("图书的收您：" + book.getPrice()+ " 元");
    }
}
